Fixed bug on collisions

Checking for collisions and avoiding them by not performing the
movement (1st version).