Use mechanism for obtaining the upper limit value.

This shouldn't be merged until Travis CI succeeds.