Fix compatibility where possible