diagnosisAfter and other bugs fixed