app: more valgrind fixes