Fixing warnings and ambiguities