Merged in dlech's ui event changes