Fix some more deprecation warnings.
Preparing release 4.0.2
Back to development: 4.0.3