Improve client IP detection