tests to increase robustness, some better error messages, but still not
100% there