partial fix for #981