Fixes #154 (and fixes #143)