make sure that `reset` runs after an exception

Signed-off-by: Mattias Andrée <maandree@operamail.com>
make the previous commit optional

Signed-off-by: Mattias Andrée <maandree@operamail.com>