Fix compiler issues with externs and global pollution.