buildrepo calc fixes. Should be working quite well now.