Add tests for limit and offset substitution