Fix bug in index and remove some debugger statements