Moved scaling to earlier in the process

I was seeing issues where the scaling was done out of order. From my testing this seems to be the better way to handle it.