csrf-fix: Improve parsing, corner cases