memory fixes after running valgrind

refs #152
more memory fixes

refs #152
memory fixes, mostly for single-thread mode

refs #152