Correctly normalize values and handle zero inputs to scalbn functions.