minor cleanups
fix null dets bug