Fix some type errors and deprecation warnings

This makes the test suite pass again on edge Julia, fixing #77.