Raising correct-er errors for when closed or EOF reached

although the specs still don't match (???)