Fix a bug about wrong output when input is not integer