Fix bug in IDF export (plus minor cleaning up of IDF/VRML export)