Fixed code for future template changes.