couple fixes

Here's the cleaned up commits from my prior valgrind branch. Thanks for this great WM!