Partial fix for #379.