merged bkmeneguello's fix for #68

This addresses issue #68, using a commit from @bkmeneguello's `custom` branch.