Fixes and new tests added