Checking for tags and other cleanup