Advanced fix for assertion