r2415 fixed upgrade procedure and a few bugs