Added a few missing casts, TPT can now be compiled with stc=c++0x,
which is needed for the c++11 threading libraries.