fixes, tests passing