Some fixes in collision handling, still unstable