Run tests in checked mode, and fixed a type error