Properly pad generated segment filenames

Closes #1.