Fix memory exhaustion

Truncate messages to the size of the tx in them