Fixes #112. Fixes #140