That was easier than I thought. fixes #251, fixes #246