Fixes valgrind issues

refs #4410