Changed the way the marginal variables were queried