enable valgrind on travis-ci
fix uninitialized scalar variable, add test