Fixing bug when removing empty keys from CSV