Fix NPE when no targets.