Move environment assignment from next clause to exec clause.