Fix app upgrade from 3.0 and 3.1