RDMP engine cleanup and dictionary optimization, some new bugs surfaced :(