(PE-3098) Addressed PR comments and added a test