Alter error message to resemble that in check_type