Could you explain why are you testing if Firstname and Lastname are null ? This is not a sufficient condition to prove that the user was removed by the filter. Some users may don't have Firstnames and Lastnames in LDAP