Fix exit action issue

Make sure exit actions are executed in all cases in
which no user code is being run.