Fixed bug where failing to grab the system cursor would cause a segfault.