Fixed bug #986, thanks to Sebastian Kurfuerst.