Fix for #940