Fix the behaviour of scaleFloat; part of #3898