Fix User Agent detection