Changed flags in source Makefile to compile with -Wall
Fixed memory leaks found in valgrind analysis