TRUNK-3884. Resolved and sucessfully tested.

Thanks Ben and Daniel for the debugging help.