Fix EOF handling when closure operation was skipped (fixes #218)