Fixing template files.
Fixing secorrect code so that it works with animal density models.