Make variables global by default.
Add clone method to Error classes.
Minor cleanups.