Bug fixes and workarounds

Bug fixes and workarounds, most notably a workaround for #107