Fixed a bug in the index template