Fixing template bugs.