Add rows for referential integrity

This (along with #1400) fixes #3079