Fixed bug + added footer

Creating the index files we were using %s instead %d for the filename.