[#1] Add code to rebuild database if invalid version detected.

Fixes #1.