extern fixes and trace cleanup.