Make library work again with 3.1