Fixes to run and test in checked mode