Fixed a couple of bugs with the index template