Improved priority detection of high order functions.