Fixing some merge issues. Adding a unit test