821 fix doubleclick

"Fixed" by using click rather than double-click because Chrome mobile and Safari mobile do not support double-click (or double-tap) events at all.

Also fixed some other errors that had been introduced during refactoring.