Cleanup old code & fixed limit in repo query.