Small improvements and added one more unit test