Corrected data element padding function