Improve priority checking