Fixed analyzer issues with unused values, one memory leak