More fixes and new output format