Fixed some Bugs with PHP 5.4