fix some kinks in the populate query