Fixed tempalte issue and added some HTML debug comments