Small fixes.
Unit tests added.