EndMode works, except for eject.
Removed unused code.
Fixed EndMode.