Added util method to coerce values into ranges