fixes #224 and fixes #241