This fixes #8105 and #8103