Bug fix for class AABB (axis aligned bounding box).

The pull request contains adding tests to detect the bug and the bug fix itself.