Fixed bug in SWORD diagnose script.