Housekeeping changes to detectability.r and sp_detectability.r