Some JS related and Analytics code related fixes