Fix get_char function problem