Patch requested by Bjoern

Tested, works.