Fixing issues with class enum
Adding missing typename keywords
Replacing __int64 with protable type
Removing unused variable