Correct issues that prevented compilation with NAG, and for which -wmismatch does not work or is overkill.