Potential fix for #619; needs testing