fix tag import when no parent commit is found
fix few memory leaks in new code