Fix ordering of same priority items