Fixes for #059, #085, #093