Fix for: Exporter hits an infinite loop if a term has a non-existent parent

See #924.