Attempt to fix EOF bug