While changing from debug mode to release in Visual Studio makes the correct result. So where is the problem?