Fixed some of the issues mentioned in the pull request