Fix bug in formatting of device IDs.

Previously, leading zeroes in device IDs were getting chopped off.
This commit ensures all device IDs are exactly 14 characters long.