Fixes for #278
Fixes for #284