Resolved some warnings and rewrote event linking/unlinking