Fixes for #400