Initial attempt at fixing #691