Minor fixes and debug helpers to track externs.