Fixed memory leaks in expectations and matchers