fixes related to JSON and PG merge