Fix array_search check