isEmpty condition inverted: fix.