2. In your description, assuming waypoint E is #4 and A is #0, you
would expect E to A to be the final leg and shown on the map. What is
the problem you see?
I'd guess the marker for point E is shown superimposed on A and the
route appears to run from B through E to B, instead of A through D to
A.
One fairly easy way around that might be to make the last point very
slightly north of the first point so the last marker is stacked
underneath the first. Otherwise you're into replacing markers (so that
you make point E show an "A" marker): while I'm sure there are
examples which do that, it's easier to add 0.000001deg to the last
point.