Fixes for #76 and #77