Debugged BatchSearch and ResultWriter