Further collision bugfixes

The fixing of bugs in the collision code continues.