Added workarounds for bugs #51285 and #51281: if the AliMagF instance