fix problem where ip and mac address not copied correctly into match structure
fix issues related returning variables off the stack