added tests and an assertion for wrap-rewrites

wrap-rewrites would work with an odd number of args, I figured it's best to throw an exception so it doesn't happen by accident :)