Implement event handling, fix makeCurrent() errors