fixes for #83 and #65