Minor Fixes + UnitTests