lots of db engine related fixes; some new methods