fix npes in annotation validation