Various fixes (5.0.6/7)