Massive bugfixes to collision handling