Incorrect fix of compiler warning cause assertion always fail