Fix build warnings with diagnostic turned off.