Fix for #32
Fix for #28
Fix for #41