Cast to integer on limit and offset.
Merge branch '4.0'