fixes for #49 and #50