Fix text and control depth indices to have sane values