fix array size, optimize scale calculation
Authored by: rmottola 2012-12-25
Parent: [r332]
Child: [r334]