Fixed bug if integer list passed into nan_to_num

An error is given if a integer list is passed to nan_to_num (Trac #880)
#1478