Debugging IncompleteRead error