Fixed some bugs with cycling targets.
TemplateApplication: added a parameter check for the imported modules to
make it easier to comment out unwanted imports.