Exit hooks should be called in reverse order