Touch optimizations

Some optimizations for touch devices. Addresses #762 and #999.