Fix mouse positioning on iPhone 5

1) Fix mouse positioning on iPhone 5
2) Fix static analyzer warnings