fix buggy assertions