minor fixes, tests