Small correction to be identical to the C# version