Remove one unused variable and initialize the top event pointer.
Correct deleting of pointers in tests.
Merge branch 'develop' into coverity-scan