Fix bug when no targets are defined