Fixed bug in how distribution name is handled in scripts