Fix nonsensical result class names introduced by a test in 45f8858e6
Rename imprecisely named variables in the load_namespaces codepath

Clarify some error messages while we are at it