Bugfix: improve algorithm for generating WPX prefixes