Removed some unnecessary typecasts from Thread.cpp primitive.