Applied changes for compatibility with PyPy 2.4.0

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