Fixed #84 , #82, and #79
Merge pull request #85 from eliadil/master

Few small bug fixes.