Added toggle logging; fixed toggle example to use new unittests