Some small fixes for bug #8377.