made fewer valgrind errors.