Fixes for #53 and #56