Fixed and Added Unit Tests