Better error message if reg fails