Fixed closing of executable file