Some unnatural tricks for making this stuff compile.