Fix reading 0 bytes after ungetting a character