Fix from b977f5f8 on 0.7 branch