Fixed IOTest, cleaned up in code