Set priority if specified and ensure it is maintained on updates