Various fixes to make tests run.