Fixing some bugs in vlan handling code and preparing the ground for vlan stamping mechanism adaptation