Fixing to be compatible with CakePHP 2.4.5 and PHP5.4