Merge pull request #233 from bastih/master

Some extra cleanups that make valgrind output more readable