Added debugging and cleanup to link test

Change-Id: I0a7dc2f08267e13246637d6336af13f909bbe2b4