Fixed insertEvent and tests.