REVIEW-4083/REVIEW-4086: Added better test coverage. Removed some unnecessary code.