Minor changes and fixed #499