[TASK] Fix memory issues. Add gdb + valgrind support.