Safe dict operations to prevent unexpected errors in server messages