Fix DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future

All tests pass but changes should be reviewed.