Fix a batch bug and function signature for the apply policy func.