php 5.5 compatibility fixes