Phpupgrade and some auto build related fixes