Fixed issues as per pull request conversation