Fix typo that causes crash in debug mode and possible wrong work in rele...

...ase mode