Fix in test to use the assign function instead of an explicit loop.