 (defun node-ac-reset ()
   "Reset the auto-complete.
 Kill the ongoing Node.js evaluation process, and reset all existing data."
+  ;; Cancel timer
+  (when (timerp node-ac-idle-timer)
+  	(cancel-timer node-ac-idle-timer))
+  (setq node-ac-idle-timer nil)
   ;; Kill process
   (when node-ac-current-process
 	(when (process-live-p node-ac-current-process)
 	  (kill-process node-ac-current-process))
 	(delete-process node-ac-current-process)
 	(setq node-ac-current-process nil))
-  ;; Cancel timer
-  (when node-ac-idle-timer
-	(cancel-timer node-ac-idle-timer))
   ;; Reset cached data
   (setq node-ac-evaluated-syntax nil)
-  (setq node-ac-complete-info nil))
+  (setq node-ac-completion-table nil))
 
 (defun node-ac-syntax-under-cursor ()
   "Get the syntax under cursor, for auto-complete."

  "The syntax sent to node.js for completion.")

(defvar node-ac-evaluated-syntax nil
  "The evaluated syntax corresponding to the completion info stored in `node-ac-complete-info`.")

(defvar node-ac-complete-info nil
  "The complete information of auto-complete candidates.
The info is stored in terms of a list. Each entry is a list:
 (list candidate symbol description documentation yasnippet)")

(defvar node-ac-idle-timer nil
  "The timer that triggers auto-complete when Emacs becomes idle.")

  (let ((start-point nil)
		(snippet (car (cddddr
					   (assoc selected-candidate
							  node-ac-completion-table)))))
	(unless (string= "" snippet)  ;; Only continue when a snippet is returned
	  ;; Get the point where the syntax of the candidate starts
	  (save-excursion
