Fixed bugs with codexpagescale handling