Fix illegal seek bug