Fix mouse mapping bugs, add frame counter