# Appendices in PDF Outline appear as children of first appendix and problem with headers

I have a problem similar to the one in Appendices in PDF Outline appear as childs of last section

But the solution hasn't worked for me, and I even get errors when I try to `\includepackage{bookmark}`.

So the problems are:

1. Appendices in the PDF outline appear as children of first appendix;

2. The PDF bookmark for the appendices points to the first two chapters;

3. At the references/bibliography the headers are set with the previous chapter values;

I've been all day trying to solve this and I just gave up.

-

You are loading `hyperref` too early. The problem occurs because you load it before `fncychap`. It goes away if you move `hyperref` after `fncychap` in the loading order in your style file.
`hyperref` should be loaded as latest package, with some exceptions, because it redefines a lot of macros of basic LaTeX and such used and redefined by other packages.