Fix referencing and replace fancyhdr by scrlayer-scrpage