Fix issue #994 thanks to Jan Oberländer