(XDK) Some cleanups to find_and_set_first_file