Fixed NullReferenceException upon calling HeadAttachment()