Bug fixes for NIO reader