Fix analytics, tests and deployment script