This also includes a fix for the trimming function and thus fixes #7306. Signed-off-by: Michael Heimpold <mhei@heimpold.de>