applied patch by Markus Döring (fixes #158)