Merge pull request #48 from @jzskca

Sanitize input to offset() and limit()

Merged manually as the original PR was to 3.3/master.

Closes #48.