Adds a proper error messages and fixes undefined keys
Merge pull request #28 from antonigiske/patch-1

Adds a proper error messages and fixes undefined keys