0_21 fix

Minimalist changes for 0.21. Works for me, but I did not test every function.