Fixing assertion error in test