Fix issue 'done' is not called when no target file specified