import script and a few db fixes