Added debug facilities
WIP