partial fix for #1222