.NET 4.0 Compatibility

.NET 4.0 Compatibility and replace out param by ref param