partial fix for #649