Fixed type 4 in analytics.py, and removed obsolete code.