Fixed several bugs
Merge pull request #2 from enumag/patch-1

Fixed several bugs