Fixes for isses #25 #26 and #27