Improve collision code in TestState