Fixed unit test.
Added keep alive checks between servicing each key.