Fixes for #44 and #54