Bug fixes
Merge pull request #8 from sventer/bug_fixes

Bug fixes