Applied some changes according to comments.