Added most unit tests