Fixed more bugs related to the wall collision detection.