Fixes for #212, #213, #210