Restrict min/max values in refs