Add strict checks to hex to binary conversions.