Trim garbage bytes from prefix and suffix on tags