Fix for #140
Fixes for #146, #136, #135