fixed the asserts that would have broken the behavior if built in release mode