Cleaned up stuff and fixed events