Proper handling of null values when a number is expected