Added remaining tests, fixed some more issues.