Fixed a bug that broke create diagnostic code functionality