Fixed a mess with extern variables definition