more robust type errors