patcher uses more efficient dict access

updated tests as well