Fixed adapter throwing illegal exception when header/footer added