Misc. bug fixes.
More database connectivity improvements in Mathematica scripts.