fixes #1 and similar issues, see HISTORY.rst for details.