Fix several bounding box bugs.