Fixes issue #1073. Please, post your contribution following our coding style, otherwise I have to waste a lot of time cleaning up the code --HG-- branch : trunk