Make detectors 0 based instead of 1 based