Fix assertion bug