Fixed a few issues with the keyboard and shutdown