Small bug fixes with the decodeHex function