-d option outputs diff twice

Existing code outputs diff twice for code without comments and crashes on code that has comments oonly