Fixed some bugs, but keyboard input doesn't work. :(