Fixed collision detection with rectangles