Fixed a bug in the bug collision detection