Fixed upgrade procedure for 0.3 to 0.4