Fix NPE after disabling logging which breaks deadlock detector. Fix occasional NPE in collisions.

Signed-off-by: Ross Allan <rallanpcl@gmail.com>