Fix many external Raet refactor bugs