fix finally transformPackageVersion()
modify array_pop() and work with a reference