Fix database upgrade crash (Fiends & profile) Fixes #82.

This fix will fix the database upgrade crash.