Fix wrong assertion

Fixes issue #2196
Merge pull request #2197 from linquize/assert-wrong

Fix wrong assertion