Fixed: assertion using wrong index