Reimplement wrap, all tests now passing again