fixes for key not found and null reference exceptions
Merge pull request #8 from csnate/issue-7

fixes for key not found and null reference exceptions