Correctly parse pragma headers. Fixes #13501