Fix commitTree refactor bug