Compatibility fixes
Portability fix