improve formatting and fix bug in case analysis results are invalid