Add primary auto-increment ID column, fix bug introduced in previous commit