optimize editscript
fix gcc uninitialized error
Merge pull request #228 from Garonenur/editscript

Editscript
A bit kludgy, but fixes #224.
Merge pull request #233 from standage/attrcheck

A bit kludgy, but fixes #224.