Php 5.4.x fixes