Fixes a number of ambiguous cases