Fixing PHP5.4 compatibility in 1.X branch