Some bigfixes and compatibility fixes.