Initialize properties as arrays so the foreach doesn't break

The foreach loops around line 144 break when some properties are not defined and stay NULL instead of an array, which triggers a PHP warning.