Fixed some possible issues in reverse for loop action.