Partial fix for #333