Ensure result is always array
Replace uniq method with a better one