Fixed overflow issue during message conversion.