Fixing sqlite database