Adding fix for JERSEY-2407

This passed unit tests as well as my local testing in a few test cases in our environment.