Copied offset bug fix to touch events