0.5.10 mt fixes

Merge in 0.5.10 multithreaded fixes from Rob Davies