Critical fixes

Fixed #596, #597, #565 and crash when opening daigram during interpretation (no bug in bugtracker)