small fixes, tests