fixed some bugs

fixed not setting searchfor to null when file becomes indexed, and a
list iterator that did not move forward, and a malloc that didnt happen