Fixes to infrastructure & to pg test