fix logic in agent.lua regarding to config.

so that only one of the three options can be used. This commit fixes the
failed "clearer logic" in #526.