This fixes #8344.
Some more small fixes for bug #8344.