minor typo fixes in middleware