Working on tests a bit and cleaning up code.