Less brittle through relationship testing.  Closes #1292.