Partial fix for #304