Fixed asserts that break in release (-NDEBUG) configuration