fix 3 flaws detected by valgrind and bump version to intermediate version