Fix 0.4 deprecations. Fixes #57.