#59, #31 PHP 5.5 Creating default object from empty value

Creating default object from empty value error fix.