Fixes for #110, #111, #112