Add test for custom stripping rules
Fix key matching