Added 'final state -> empty stack' conversion