Various changes to better handle serial and ID columns.