Fixed Kayvan's suggestions in pull req