Fixes for #94 and #204