Fixed bugs, refactored reader_t.