Fixes for valgrind errors