Added restore script.

Fixed a crash in one of the erlang thingies.