fixed issues #67, #68 and #69