Improve keyboard support, other fixes