Moved analytics code lower
Cleaned up small bugs for release