Add functional tests for exit code and flags, fix architecture test verification