Added some tests and fixed others.