# What bug fixes can be implemented in init.m?

In comments on this question, Mr. Wizard suggested a community wiki to share the bug fixes/workarounds (or possibly other tricks) people load in their init.m. I think this could provide a nice resource.

• I think this should probably be restricted to bug fixes and workarounds or it becomes too broad. Aug 16, 2013 at 21:54
• Should these be version-tagged? Aug 17, 2013 at 16:54
• @Yves I think they should, and so far it looks like everyone has already done that. Aug 17, 2013 at 20:51
• Tangentially related: (56728) Feb 12, 2015 at 10:38

Fixes by Mathematica version. Note that unfixed bugs may apply to earlier versions as well; e.g. TableAlignments -> Left not working also applies to version 7.

# Version 10.1

• Unprotect[Trace];
SyntaxInformation[Trace] = {"ArgumentsPattern" -> {_, _., OptionsPattern[]}};
Protect[Trace];

• Fix Incompatibility of Row and TeXForm: (v9+)

BoxForm$UseTemplateSlotSequenceForRow = False;  • DateListPlot; (* preload; do not remove! *) With[ {dv := DownValues[GraphicsDateListPlotDumpiDateListPlot]}, dv = dv /. (fr : FilterRules)[a : GraphicsDateListPlotDumpopts, b_Options] :> fr[Join[a, Options @ GraphicsDateListPlotDumpcaller], b] ];  • code too long to include; provided in answer linked above • see answer to link above • With[ {dv := DownValues @ PacletManagerPackageloadWolframLanguageCode}, dv = dv /. wl : HoldPattern[ToString @$SystemWordLength] :> RuleCondition[wl];
]

• InactiveDumpassembleInactiveSumProduct[
{args_, disp_, interp_, char_, tag_, tooltip_, fmt_}] :=
TemplateBox[ args, tag,
DisplayFunction -> Function[disp],
InterpretationFunction -> Function[interp],
SyntaxForm -> char
]

• GraphicsArrayPlotDumpPrivatestripOptions[opt2___, OP_] :=
Module[{opt = Flatten @ {opt2}},
Delete[opt,
Position[opt,
g_?(SystemUtilitiesStringName[#1] ===
SystemUtilitiesStringName[OP] &) -> _,
{1}
]
]
];

• ConvertTeXExpressionToTeX; (* preload; do not remove! *)

Begin["SystemConvert"]

With[{DV := DownValues[TeXFormDumpmaketex], RLS := CommonDumpRemoveLinearSyntax},
DV = DV /.
Verbatim[RLS][arg_, CommonDumpRecursive -> val_] :>
RLS[arg, CommonDumpConvertRecursive -> val]
]

End[]


# Version 10.0

• (fixed in 10.0.1)

VisualizationUtilitiesOptionsDumpunitFormStringQ[HoldForm[s_]] = False

• (fixed in 10.0.2)

SetSystemOptions["ParallelOptions" -> {"MachineFunctionParallelThreshold2" -> Infinity}]

• Fix A bug in Commonest in version 10 (see link for an additional performance enhancement):

(fixed in 10.0.2)

StatisticsDescriptiveDumpoCommonestSetLength[list_, 1] := Commonest[list][[{1}]]

• (fixed in 10.1.0)

Begin["TypeSystemInferencePackagePrivate"];

exprType[e_Association] :=
If[AssociationQ@Unevaluated@e, Struct@MapUn[exprType, e], TypeSystemUnknownType];

End[];


# Version 7

As a version 7 user these likely don't apply to most users but here are mine:

• Fix Symbol name slow-down weirdness (hashing problem?):

SetSystemOptions["NeedNotReevaluateOptions"->{"UseSymbolLists"->True}];

• Fix a bug in FullSimplify:

Unprotect[HolonomicHolonomicFullSimplify];Clear[HolonomicHolonomicFullSimplify];

• Prevent Mathematica from eating all my RAM and freezing (most of the time):

$Pre = Function[Null, MemoryConstrained[Unevaluated @ #, 2^32, "Memory Exceeded"], HoldAll]  • It would probably be good to include a version check before applying any fixes. Jan 19, 2015 at 16:21 • @Szabolcs Would you elaborate on that, please? Jan 19, 2015 at 16:22 • If[$VersionNumber == (* number *), ( * do this *)] was probably meant… Jun 19, 2015 at 21:40
• @J.M. Perhaps so. I prefer to maintain the fixes manually. Jun 19, 2015 at 21:41
• @Mr.Wizard Yes, that's what I meant. It's critical when one has multiple versions installed. Doing this without a version check is dangerous. Someone might copy a fix from here, forget about it, update Mathematica, then something suddenly gets broken. Apr 10, 2019 at 11:48

Here is one that came from a Wolfram employee so it should be safe to add in version 9:

FindInstance returns Indeterminate in version 9, but not in 8

Here's a patch from Adam Strzebonski of Wolfram, which fixes a bug in RootReduce[] in 9.0.1.

ToNumberField won't recognize Root as explicit algebraic number