Fixed some possible cross-thread UI calls. Hope this fixes #47