(PE-4372) Added a test and addressed PR comments