Minor porting and debugging tweaks