Adding defensive code.