Another attempt at fixing #341