Fixed bugs, checked in pointer events patch