Removed Edit/Object mode switching which was causing errors with name
strings, specially utf-8 encoding.