Fix handling of remove attr on import/export.

Attempting to remove an element from a list, when it wasn't in the
list already, caused it to be added instead.