Fixed some bugs. Added first Unit Test.