iD.modes.DrawArea = function(wayId) {
    var mode = {
        button: 'area',
        id: 'draw-area'
    };

    mode.enter = function() {
        var map = mode.map,
            surface = map.surface,
            history = mode.history,
            controller = mode.controller,
            way = history.graph().entity(wayId),
            headId = (way.nodes.length == 1) ?
                way.nodes[0] :
                way.nodes[way.nodes.length - 2],
            tailId = _.first(way.nodes),
            node = iD.Node({loc: map.mouseCoordinates()});

        map.dblclickEnable(false)
            .fastEnable(false);
        map.hint('Click on the map to add points to your area. Finish the ' +
                      'area by clicking on your first point');

        history.perform(
            iD.actions.AddNode(node),
            iD.actions.AddWayNode(way.id, node.id, -1));

        surface.selectAll('.way, .node')
            .filter(function (d) { return d.id === wayId || d.id === node.id; })
            .classed('active', true);

        function mousemove() {
            history.replace(iD.actions.MoveNode(node.id, map.mouseCoordinates()));
        }

        function mouseover() {
            var datum = d3.select(d3.event.target).datum() || {};
            d3.select('#map').classed('finish-area', datum.id === tailId);
        }

        function click() {
            var datum = d3.select(d3.event.target).datum() || {};

            if (datum.id === tailId) {
                history.replace(
                    iD.actions.DeleteNode(node.id),
                    iD.actions.AddWayNode(way.id, tailId, -1),
                    'added to an area');

                controller.enter(iD.modes.Select(way));

            } else if (datum.id === headId) {

                // finish the way
                history.replace(
                        iD.actions.DeleteNode(node.id),
                        iD.actions.AddWayNode(way.id, tailId, -1),
                        'added to an area');

                controller.enter(iD.modes.Select(way));

            } else if (datum.type === 'node' && datum.id !== node.id) {
                // connect the way to an existing node
                history.replace(
                    iD.actions.DeleteNode(node.id),
                    iD.actions.AddWayNode(way.id, datum.id, -1),
                    'added to an area');

                controller.enter(iD.modes.DrawArea(wayId));

            } else {
                history.replace(
                    iD.actions.Noop(),
                    'added to an area');

                controller.enter(iD.modes.DrawArea(wayId));
            }
        }

        function backspace() {
            d3.event.preventDefault();

            history.replace(
                iD.actions.DeleteNode(node.id),
                iD.actions.DeleteNode(headId));

            if (history.graph().fetch(wayId).nodes.length === 2) {
                history.replace(
                    iD.actions.DeleteNode(way.nodes[0]),
                    iD.actions.DeleteWay(wayId));
                controller.enter(iD.modes.Browse());
            } else {
                controller.enter(iD.modes.DrawArea(wayId));
            }
        }

        function del() {
            d3.event.preventDefault();
            history.replace(iD.actions.DeleteWay(wayId));
            controller.enter(iD.modes.Browse());
        }

        function ret() {
            d3.event.preventDefault();
            history.replace(iD.actions.DeleteNode(node.id));
            controller.enter(iD.modes.Select(way));
        }

        surface
            .on('mousemove.drawarea', mousemove)
            .on('mouseover.drawarea', mouseover)
            .on('click.drawarea', click);

        map.keybinding()
            .on('⌫.drawarea', backspace)
            .on('⌦.drawarea', del)
            .on('⎋.drawarea', ret)
            .on('↩.drawarea', ret);
    };

    mode.exit = function() {
        var surface = mode.map.surface;

        surface.selectAll('.way, .node')
            .classed('active', false);

        mode.map.hint(false);
        mode.map.fastEnable(true);

        surface
            .on('mousemove.drawarea', null)
            .on('click.drawarea', null);

        mode.map.keybinding()
            .on('⎋.drawarea', null)
            .on('⌫.drawarea', null)
            .on('⌦.drawarea', null)
            .on('↩.drawarea', null);

        window.setTimeout(function() {
            mode.map.dblclickEnable(true);
        }, 1000);
    };

    return mode;
};

@@ -1483,339 +1483,34 @@
 ilId
-) %7B%0A                history.replace(%0A                    iD.actions.DeleteNode(node.id),%0A                    iD.actions.AddWayNode(way.id, tailId, -1),%0A                    'added to an area');%0A%0A                controller.enter(iD.modes.Select(way));%0A%0A            %7D else if (datum.id === headId) %7B%0A%0A                // finish the way
+ %7C%7C datum.id === headId) %7B
 %0A   
@@ -1542,33 +1542,8 @@
 ace(
-%0A                        
 iD.a
@@ -1572,123 +1572,11 @@
 .id)
-,%0A                        iD.actions.AddWayNode(way.id, tailId, -1),%0A                        'added to an area'
 );%0A
-%0A
     

Fix area closing (no duplicate nodes at end of way)