fixes and tests added