Add tests to achieve near-complete coverage.

Fix small bugs with wrapper arguments.