Bugfix for discovery and hostname setting in script. Rework of application list on template