Remove unused function
Fix race conditions with UI events.
Add method to simulate pressing the return key
Fix timing of latest validation, and leak.