Minor bugs - PHP 5.4.6

Removed few minor bugs found durring migration to new php