Fix various issues found by eric
Merge pull request #109 from cloudspace/bug_fixes

Fix various issues found by eric