Add valgrind checks

Fixed 3 memory leaks
Fix proxy test... Really, this time