Fixed issue #111

There was an issue when the buffer read ended between \r and \n. Credits go th Balchen for the fix.