Add stats printing functions, fix usedslots bug