Fixes the Error_EOF issue

I tested it on my Mac OS X Maverick and it seems to work. Now I've got a nice error message instead of an evil crash.