Fix assertion bug in test