Fix bug where priority doesn't work. Also, make sure priority doesn't exceed Required level.

Change-Id: Ida25c6ef164cd64615b51c1f65684370f59bd93e