Fix #4914

Fix #4914 by ignoring annotations with the hidden flag.