Fixed random crash on cancelling contact tests