General tile collision code improvement.