Fix issues with the string formatting functions when the alpha channel is zero

The alpha channel was ignored when it was zero and was treated as if it was `undefined`.