Fixes for Cakephp2 upgrade