TRUNK-3903 Resolved and tested.

https://tickets.openmrs.org/browse/TRUNK-3903 Resolved and tested. Please merge.