Fixed asserts in working code