fix deprecation warnings for 0.4