Jean-Rene,
I don't see a problem with PEMSTATUS() in your code. That function only creates a problem when it appears more than twice on the same line of code as in;
IF PEMSTATUS(...) AND PEMSTATUS(...) AND PEMSTATUS(...)
Of course with all of the macro expansion you may be referring to things that don't exist or somehow creating object referecnes unintentionally.