Fixed some bugs with keyboard and moving