Fix timer bug.

In Emacs < 24.4 there is a timer bug, which this commit fixes.