fix deprecation warnings in 0.4