Range check

Check range.lower/range.upper !== undefined, rather than truthiness, as e.g. 0 may be specified as a valid range bound.