Fixes for #26 and #28