Fixed trackEvents to allow optional parameters and changed some minor issues.