Cleaned up BufferReader code (removed debug and tightened flow).