Fix an empty object detection implementation