Added default objects if undefined. This should fix issue #2
Merge pull request #3 from Robinfr/master

Closes #2.