Bugfix: use only profile ids that are set.