Minor improvements for updating count of directories in repository