Fix issues found by cpychecker.