fixed segfault, and relative mouse movement is now working.