Patch with fixes to compile apsim76