Backporting X-Forward-* bug fixes from master