Fixed Events bug and added test