bugfix: last commit introduced a stupid bug where object.x was used instead of object[x]. This got fixed and also the typeof function check was replaced with a more simple is not undefined.