Make reset more robust