Fix EOF problem with reducer