Fix a bunch of type mismatch-related warnings (Jan Kiszka).