Fixed a bug causing extents calculated incorrectly.