minor fixes and tests