Implement EOFError + changes useful for debugging