Fix upgrade tool