More compatibility work + various fixes.