Fixed a bug in the text routine

Change-Id: I0a7b267cdb7d27aac863c78b7cb9e97c2b612922
Reviewed-on: https://iffwww.iff.kfa-juelich.de/review/62
Reviewed-by: Josef Heinen <j.heinen@fz-juelich.de>