[FOLD] select fixes, db creation fixes