Fix compatibility problems