fix STM issues reported by rjmac
fix thread.js trace message