Fix limit handling and add tests for both limit and skip