3.9 compat

Fixes compatibility issues with 3.9 by just being less hacky.

Fixes #2