tests added, fixed errors