fixed a few more bugs
Merge pull request #8 from andrepl/master

fixed a few more bugs