Fixed assertion error when running on debug.