Minor changes in SA.
Added new tests.