Fix some minor bugs in postgres backup