git-svn: fix several small bugs, enable branch optimization