Some small changes and fixes
Added Test suite