various and sundry fixes to make it run