Fixed a :bug: where there was too much querying going on.