Fix z scaling processing