I'm using the Longman complete course for the TOEFL test and even though the skills are very good I hate that the instructions call for some elements to be identified and determine if the sentence is correct or incorrect, the answers only tell you the last part so I have no way of knowing if I identified all the elements correctly.
I'm in skill 22, make inverted verbs agree and I can't identify the word or group of words that causes the subject and verb to invert in #6
The computer programmer was unaware that there was so many mistakes in the program he had written.
I selected the second "was" as my verb and "mistakes" as my subject. The correct sentence should be "were so many mistakes", therefore the sentence is incorrect.
I cannot find which category the sentence fits. I'm attaching the skill, please let me know if you need all the other skills mentioned in the first paragraph.