Datastore does not work on non-english pg

This pr collects fixes that went into master for the 2.0 release.

It fixes #718 and #642