     tabQueue[openTabInfo.windowId] = [openTabInfo]
 
   delete openTabs[tabId]
-  delete framesForTab[tabId])
-
-chrome.tabs.onActiveChanged.addListener((tabId, selectInfo) -> updateActiveState(tabId))
-
-chrome.windows.onRemoved.addListener((windowId) -> delete tabQueue[windowId])
+  delete framesForTab[tabId]
+
+chrome.tabs.onActiveChanged.addListener (tabId, selectInfo) -> updateActiveState(tabId)
+
+chrome.windows.onRemoved.addListener (windowId) -> delete tabQueue[windowId]
 
 # End action functions
 

  sendRequestToAllTabs({ name: "showUpgradeNotification", version: currentVersion })

# Ensure that openTabs is populated when Vimium is installed.
chrome.windows.getAll({ populate: true }, (windows) ->
  for window in windows
    for tab in window.tabs
      updateOpenTabs(tab)
      createScrollPositionHandler = ->
        (response) -> updateScrollPosition(tab, response.scrollX, response.scrollY) if response?
      chrome.tabs.sendRequest(tab.id, { name: "getScrollPosition" }, createScrollPositionHandler()))


getCurrentTimeInSeconds = -> Math.floor((new Date()).getTime() / 1000)

chrome.tabs.onSelectionChanged.addListener (tabId, selectionInfo) ->
  if (selectionChangedHandlers.length > 0)
    selectionChangedHandlers.pop().call()

repeatFunction = (func, totalCount, currentCount, frameId) ->
  if (currentCount < totalCount)
