fixed some last issues with templates