Clean up collision code & improve slightly.