fix "limit" and "skip" logic in io (still not very good, though)