Workaround for apparent REST API bug. Adds safety net.