agent: s/basd/based/
engine: use nilness check
engine: fix docstring