Fix for #806, though this may address a symptom rather than a cause