Fix compability issues with PHP<5.4