More fixes, tests working.