Fix type of priority in plugin config

If priority was set in the config section of a plugin, it's type was not converted to int. I have included a unit test for this.