Make envir.py work (sort of) and improve debugging in the collector.