Made junit tests.
Minor changes.