Fix active/passive check. Thnaks  Frederic Mohier for the patch