27. While carrying my books to the library, a squirrel darted across my path.
You're right, this is not grammatically correct.
There is a misplaced modifier. As written, it sounds like the squirrel was carrying the books to the library.
It might be better to draft the sentence as follows: "When I carried my books to the library, a squirrel darted across my path."