[FIX] Fixed bug that caused error if an object was undefined