Some fixes for PHP 5.4 and windows