ensure debug logging is behind debug flag
fixes to handle listing of entities