Updated all warnings to comply with .net 4