Merge "Fix text and control depth indices to have sane values" into devel/master