Cleaned up keyboard error handling