Added explicit nil check.