Clean up warnings. Fixes trac #9377.