fixed two bugs
different dealing with ambiguity