Cleaned up EventListener and fixed a few minor bugs