Added some more tests and fixxed some issues with code when they showed up. More tests are still needed.