Import fix from Kex, improper flag logic