Tested with valgrind