Fix for vlan end calculation