Patched my patch!

Did some major code cleanup on my changes to the reply filter and fixed some bugs along the way.