A couple of fixes.
This fixes #8266.