Fix deprecations

@bpot hi! I'm working on a redux of #28 - this is the part that fixes deprecations.