More porting work, still very broken