Fix for exception due to not defined variables

fixes #78