Make exceptions we throw more consistent. Streamline test imports.