Fixing some ui/event bugs