Various changes. This completely breaks the unit tests, I know. I'll update the unit tests later.