fixes to manager and gateways for persistence