fix authenticate() so that it actually returns proper results.
fix errors in modern cmod builds.