In your database, is the layout_id field of the layout_boxes table set as an "integer" and as an "auto increment" field?

Are all the layout_id values unique, or are they all set to 0, particularly for the newest entries?