Added a test, and fixed a few failing tests.