Added support for handling Events. Plus some fixes.