Fix NULL pointer deferencing in policyengine.