Fix issues in 0.6 upgrade