fixes to scale and range