Fixed some errors with collision resolution.