Prevent panic when offset or limit is negative