Interbase 4.2.2 to interbase 6.01

Hi,
Sorry about this mail, there is a lot of english error.
This application is a Delphi 4 application which turn on a Novell 4.1
server with Ib 4.2.2 serveur.
The application on Novell server is Ok no bug but

We try to use a Red Hat 6.2 serveur with a Ib 6.01 CS server.
We are connect to the linux server with Win 98 or 95 client (use samba).

We find 2 bug.

First on a stored procedure like this :

We have when we run this stored procedure with Explorateur SQL ("french
version" in Delphi 4).
We have this error message
Objet non trouv (Object not find)
alias P conflicts with an alias in the same statement.
We think that the bug is on the union (or in the not in)  : the 2
alias(P) are compared between the first and the second
select (bug?).

SELECT DISTINCT
     E.ELEVE_ID, P.PERIODE_ID, .....
    FROM INSCRIPTIONS_GRP IG
    JOIN ELEVES E
       ON IG.ELEVE_ID = E.ELEVE_ID
....
    JOIN PROGRAMMES P
       ON IG.GROUPE_ID = P.STRUCTURE_ID AND
       M.MEF_ID = P.MEF_ID
    ....
UNION
SELECT DISTINCT
 E.ELEVE_ID, ....
FROM INSCRIPTIONS_GRP IG
    JOIN ELEVES E
       ON IG.ELEVE_ID = E.ELEVE_ID
    .....
 WHERE IM.ENCOURS = 'O' AND ....
    IG.GROUPE_ID not in (SELECT P.STRUCTURE_ID
                            FROM PROGRAMMES P
                               ......
                             WHERE P.MEF_ID = M.MEF_ID AND
                               PD.DIVISION_ID = DG.DIVISION_ID)
 ORDER BY 4,5,6,7,9

Second on a stored procedure :
It a stored procedure who calculate average and have 2 results : It' s
good it's calculate or It's not good for calculate miss
this information.
We have diffrent rsulte for the same .gdb juste restored.
On Novell ib 4.2.2 or Windows ib 4.2.2  all the result is OK
but on Novel Ib 5.6 and Linux ib CS 6.01 sometime not all the time some
:
It's not good for calculate miss this information.( on ib 4.2.2 ) become
It' s good it's calculate ( on Ib 5.6 or 6.01).
When this bug become it's in gnral when it's use some fonction SQL
like "is Null" or "is not Null".
Can you say me if modification on this fonction  (between 2 result of
stored procedure) became between the Ib 4.2.2 and the 5.6 and later.
Thanks
laurent