Sanitize input to offset() and limit()
Coding standards fixes
Merge pull request #42 from @jzskca

Sanitize input to offset() and limit()

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

Closes #42.