Fixed some failing tests and added some additional tests.