UNDEFINED_LAYER is -2, so simple checking evenness isn't enough to check if it's copper or not. Notciable when the FABMASTER import puts things on UNDEFINED_LAYER while it's processing items.