better debugging options and fixed rule applier