Fixed memory leak in compare stage.