Fix stashing & unstashing logic