Updated patch to match feedback from #161.