Fix flaky specs

all.last returns an array first, and then the last element out of it.
Postgres does not guarantee order, so the results of "all" can be unexpected.