Improve internal `zeroPad` helper function