Adding tests. They still need fixing.