fixes for issues #18 and #20