Fixes #239
Fixes #240
Fixes for #95