Autodetect main programs
Fix cd error on test for failure
Merge branch 'master' into bounded