Worked out bugs of link layer