Fix SR modeling bug. Deal with bad catalogs.

Since I can't reproduce the issue in ZEN-12824, I don't yet know for
sure if this really fixes the issue. I've given the patch to a user to
try for a while to see if it fixes what is a very reproducible problem
for them.

Fixes ZEN-12824.