Added new features and fixed a global event leak.