Fix and test for USERGRID-49