bunch of compatibility fixes
merged