fixed some last minute bugs
Merge pull request #59 from antonow/more-bug-fixes

fixed some last minute bugs