some bug fixes
Merge pull request #122 from KeenS/hotfix

some bug fixes