Fix some Android threading errors