changed error from TypeError back to ValueError in check_reg_targets