Function call was wrapped into assert.

Store return value and assert on that instead, avoiding bug
when building in release mode.