aquamacs

I am using auctex with aquamacs and I have added the following lines at the ned of my latex file:
%% Local Variables:
%% mode: latex
%% TeX-master: "book"
%% End:
However, when I latex the current file it processes the whole masterfile and not just the header. I have checked TexHeaderEnd
TeX-header-end is a variable defined in tex.el'.
Its value is "^[^%
]*\\\\begin *{document}"
not sure why there is a newline in the middle?
Also I have used the same setup in the past and it also doesn't work with files for which it worked in the past.
I have also installed a new version of aquamacs (does this install a new version of auctex?).
Any help appreciated.

Found the answer myself. In the past C-c C-c would just apply the command to the buffer but this has changed and C-C C-C applies the command to the masterfile. If you want to typeset the buffer you have to type C-c C-b.`
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9003527164459229, "perplexity": 2691.0972203120364}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178361510.12/warc/CC-MAIN-20210228145113-20210228175113-00302.warc.gz"}