Corrected bug in extension processing
Fixed undo script generation