Make function definitions more permissive, and move ambiguity checks to call sites and improve them