Fix type of initial range

When we pass in ranges, the values seem to be strings rather than ints. It's only when getting the values from the database (upon refresh) that we pass in ints.

A longer term solution would be to make sure we always pass in range objects with the right type.

Fixes #1843