A couple of changes from John.

I think the first one is something you did for rats. The second fixes some SQL problems in migrations.