Some remarks on the index theorem approach to anomalies