Fixes postgres encoding issue #348