Fixed a bug with collision resolution