Fixed unbalanced save/restore