Fix issue #295

Thanks to Marco Remondini