fix compatibility issues on PHP 5.5.9