Improved collision check.