Added null check to headers.