Fix problems  with php 5.4