collision detection bugfixes