Fixed cross-thread issues.