Fixed a lot of bugs, added configurable recovery

Fixed a lot of bugs, added configurable recovery (informations are
stored into iem on break)