Fix types of 'map' and 'mapFrom'.
Verify inferred against declared types and kill dead code.