                 new PinnedTabsState {}
 
         # Restore the serialized session.
-        self = this # This object has to be stored in self because the callback function will create its own 'this'
         # This timeout ensures that the DOM elements can be edited.
-        setTimeout (->
+        setTimeout (=>
             # Get the panes DOM object.
             panes = document.querySelector '.panes .pane-row'
             panes = document.querySelector('.panes') if panes == null
 
             # Loop through each pane that the previous
             # state has information about.
-            for key of self.PinnedTabsState.data
+            for key of this.PinnedTabsState.data
                 try
                     # Find the pane and tab-bar DOM objects for
                     # this pane.


    # Observer panes
    observers: ->
        self = this

        atom.workspace.onDidAddPaneItem (event) ->
            setTimeout (->
                # Get information about the tab
                return unless e = document.querySelector('.tab-bar .tab.active')
                tab = self.getTabInformation e

                # Move it if necessary
                if tab.pinIndex > tab.curIndex

                    # Pin the first N tabs, since pinned tabs are
                    # always the left-most tabs. The N is given
                    # by the previous state.
                    for i in [0...this.PinnedTabsState.data[key]]
                        tabbar.children[i].classList.add 'pinned'
                catch
                    # If an error occured, the workspace has changed
                    # and the old configuration should be ignored.
                    delete this.PinnedTabsState.data[key]
            ), 1

    serialize: ->
