add failure case
make Event.toString smart
propagate debug flag to Context
fix condition of infinity loop check