Minor changes and test added