BEGIN fixes from Moar porting work.