Fix a couple of bugs, beginning of mouse support.