Completion: fix bug when a proposal is hidden

See the comment in the code.