Fixes #265 (manually merged)