Cleaning up a few valgrind issues.