minor fixes and tests added