             return
         }
         let r = app!.tick()
-        item.button!.attributedTitle = r.statusString
+        item!.button!.attributedTitle = r.statusString
         if timer != nil && !r.ticking {
             timer!.invalidate()
             timer = nil

        let now = clock()
        let resting = now - lastActed > restDelay
        let assumedLastActed = resting ? lastActed : now
        
        let restStatuses = map(meters) { $0.rest(assumedLastActed, now: now) }.filter { $0 > 0 }
        let ticking = !restStatuses.isEmpty
        let restStatusStrings = resting && ticking ? [format(minElement(restStatuses))] : []
        
        let meterStatuses = map(meters) { $0.status(assumedLastActed) }
        let shouldStop = any(meterStatuses.map { $0 < 0 })
        let meterStatusStrings = meterStatuses.map(format)
        
        let statusBuffer = NSMutableAttributedString()
        let statusStrings = restStatusStrings + meterStatusStrings
        for (i, s) in enumerate(statusStrings) {
            if i > 0 {
                statusBuffer.appendAttributedString(NSAttributedString(string: "  "))

    }

    func applicationDidFinishLaunching(aNotification: NSNotification) {
        item = NSStatusBar.systemStatusBar().statusItemWithLength(/* NSVariableStatusItemLength */ -1)
        let prompt: String = kAXTrustedCheckOptionPrompt.takeUnretainedValue()
        let trusted = AXIsProcessTrustedWithOptions([prompt: true]) != 0
        if item == nil || !trusted {
            NSApplication.sharedApplication().terminate(nil)
            return
        }
        
        let errorLog = ErrorLog()
        var root : String? = "~/Library/Application Support/Ergometer".stringByStandardizingPath
        var e : NSError?
        if !NSFileManager.defaultManager().createDirectoryAtPath(root!, withIntermediateDirectories: true, attributes: nil, error: &e) {
            root = nil
            errorLog.warn("Couldn't create <\(root)>" + (e != nil ? ": " + e!.localizedDescription : ""))
        }
        
        app = App(clock: systemClock, makeFile: makeSystemFile, root: root, errorLog: errorLog)
        tick()
        let mask : NSEventMask =
            .KeyDownMask |
            .FlagsChangedMask |
