Add and test wrap() function.