Misc fixes to make it run.