Return undefined instead of an empty array for detect* methods.