Fixed database version upgrade