Fix infinite loop when maxpriority===undefined
Merge pull request #1 from japgardatablocks/master

Fix infinite loop when maxpriority===undefined