Handling of out-of-range weights in config

Previously the code was changing priority instead of weight, when weight in config was out of range.