Format fixes & thread ref fixes