Fixes for #67 and #65