Fixing a issues #25, #26 and #29