SQL Backend fixes, mostly.

This is now all working strongly, on an old CentOS (redhat) system.