Sanitize input to offset() and limit()