[Bugfix] Fix the return code after running cleanup function.