MagFieldElements+MagFieldServices: Fix cppcheck warnings.
Prefer to initialize members in an initializer list rather than in a ctor body.
Remove unneeded c_str() calls.
Protect against potential null pointer dereference.
Prefer to initialize members in an initializer list rather than in a ctor body.
Remove unneeded c_str() calls.
Protect against potential null pointer dereference.