Patch supplied by Manuel Mall in bugzilla 36036 with minor modifications Submitted by: Manuel Mall <mm.at.arcus.com.au>