Various fixes for #208