Fix various mismatches found by scanner