How to set startWidth and endWidth of LineRenderer in Unity 5.5.1f1?

I used to use lineRenderer.SetWidth() before upgrading to Unity 5.5.1f1 and it was working well.
I upgraded and changed this code:

lineRenderer.SetWidth(scale, scale);

to next:

lineRenderer.startWidth = scale;
lineRenderer.endWidth = scale;

It works, but not always. A value in Inspector changes, but it doesn’t get reflected in Game. When I update the value to the same (without changing it) in Inspector, it gets reflected. It feels like a bug.
Note: I enable/disable Line Renderer components in Game at runtime.

Change the code to the next:

AnimationCurve curve = new AnimationCurve();
curve.AddKey(0, scale);
curve.AddKey(1, scale);

lineRenderer.widthCurve = curve;

Note: You should create new KeyFrame instances every time you set width. If you modify existing ones, it doesn’t work.

Download this script and attach it to the object containing the LineRenderer Component-

Download File “LineRendererAdvancedOptions.cs”

yes, this is a C# script