Fixed assertion bug