Fix triple-click bug.

Fixes #618.