fixed tests and cleaned up a little bit