minor fixes, one test still to pass