Check limit unit

Deals with #312 plus checks the bounds, so that the user cannot accidentally set lower limit to be greater than the upper one.