Fixes to object detection