fixed some collision detection. Angles are flipped in lua