SQL backend; fix tests; only 3-4 more failing (weirdly undeterministic)