Remove trailing space in messages

(port of I840640508dd60981e71f0f944720412e9bdc3ec2 from compat)

Change-Id: I16f9da8d3e1d3574e5457fd171fb951746af27b1
Merge "Remove trailing space in messages"