Fixed the insere_final function.