Fix threading issues

r? @photex