Some small fixes for bug #8366.