Fix notices and using not-defined variables
Merge pull request #3 from vsychov/master

Fix notices and using not-defined variables