Merge pull request #18 from taymiri/master

Fix bug #27
Bug fix #21
Merge pull request #28 from glorilla/PR21

Bug fix #21
Bug fix #24 .
Bug fix #24 .
Merge pull request #29 from taymiri/pr24

Bug fix #24
Bug fix #25
Merge pull request #30 from glorilla/PR25

Bug fix #25