Clean up; fixed tests