Fix/xt postgres

fix all test in Pg.

This p-r contains #117 and #118 fixes.