Add return of func for decorator, deepcopy subprocess.check_output to avoid inf loop.