VarWorker: more error checks.
Unit tests.
Issue #29