few fixes to make it work on the latest ASP.NET Identity