Fixing pg.coffee to make it fault-tolerant, also: error logs