Cleaned up some stuff for bug #8365.