Fixing some race conditions where the user could get the UI into a very funky state