Fixed memory leaks issues found with Valgrind